﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Admin_Program : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Convert.ToString(Session["Dangnhap"]) == "")
            Response.Redirect("~/Admin/Login.aspx");

        else
            Response.Write("Xin chào " + Convert.ToString(Session["Dangnhap"]));
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        TextBox1.Visible = true;
        TextBox2.Visible = true;
        btnEdit.Visible = true;
        Label2.Visible = true;
        Label3.Visible = true;
    }
    protected void Button4_Click(object sender, EventArgs e)
    {
        SqlDataSource1.Update();
    }
    protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
    {
        TextBox1.Text = HttpUtility.HtmlDecode(GridView1.Rows[GridView1.SelectedIndex].Cells[1].Text);
        TextBox2.Text = HttpUtility.HtmlDecode(GridView1.Rows[GridView1.SelectedIndex].Cells[2].Text);
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Response.Redirect("~/Admin/Add_program.aspx");
    }
    protected void Button3_Click(object sender, EventArgs e)
    {
        SqlDataSource1.Delete();
    }
}
